import {Spin} from 'antd'
import React,{ Suspense } from 'react'
// 形参就是传递进行的组件
// Suspense 这个是react的内置组件 处理组件的等待状态的
const LazyLoad = (Com:React.LazyExoticComponent<any>):React.ReactNode=>{ 
  return (
    <Suspense fallback={<Spin 
        size='large' 
        style={{
          display:'flex',
          justifyContent:'center',
          alignItems:'center',
          height:'100vh',
        }}
        ></Spin>}>
      <Com/>
    </Suspense>
  )
}
export default LazyLoad